Compounds 2-5 were designed as potential antifolate nonpolyglutamatable inhibitors of thymidylate synthase (TS). These analogues are structurally related to 2-amino-4-oxo-5-substituted quinazolines and 2-amino-4-oxo-5-substituted pyrrolo[2, 3-d]pyrimidines which have shown excellent inhibition of TS and, for the quinazoline, significant promise as clinically useful antitumor agents. Compounds 2-4 were synthesized by appropriate amine exchange reactions on pivaloyl-protected 5-dimethylaminomethyl-substituted 6-methyl pyrrolo[2,3-d]pyrimidine 7 which in turn was obtained from the Mannich reaction of pivaloylated-6-methyl pyrrolo[2, 3-d]pyrimidine 6. In instances where the amine exchange reaction was sluggish, the Mannich base was quaternized with methyl iodide which afforded much faster exchange reaction with improved yields. For compound 5, 4-mercaptopyridine was used as the nucleophile and reacted with 7. The analogues 2-4 inhibited Lactobacillus casei (lc) TS and recombinant human (h) TS with IC50 in the 10(-4) to 10(-5) M range. Compound 5 inhibited lcTS and hTS 20% at 26 and 25 microM, respectively. In addition, compound 5 inhibited the growth of Pneumocystis carinii and Toxoplasma gondii cells in culture by 76% at 32 x 10(-6) M and 50% at 831 x 10(-6) M, respectively.